﻿using FI.Core;
using FI.Core.Configuration;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FI.EntityFramework.Configuration
{
    /// <summary>
    /// Overall configuration settings for FI EntityFramework.
    /// </summary>
    [ConfigurationSectionName(Constants.ConfigurationSections.EntityFramework)]
    public class EntityFrameworkSettings : ServiceLocatableSettings
    {
        private const string SystemFieldProperty = "systemFields";

        /// <summary>
        /// Gets the collection of defined <see cref="SystemFields"/> objects.
        /// </summary>
        /// <value>The system field.</value>
        [ConfigurationCollection(typeof(SystemFieldData))]
        [ConfigurationProperty(SystemFieldProperty, IsRequired = true)]
        public NamedElementCollection<SystemFieldData> SystemFields
        {
            get { return (NamedElementCollection<SystemFieldData>)base[SystemFieldProperty]; }
            set { base[SystemFieldProperty] = value; }
        }
    }
}
